package com.xyw.code.study202007291.functiontet;

import java.util.function.Consumer;
import java.util.function.Predicate;

/**
 * Created with IntelliJ IDEA.
 * User: xuyiwei
 * Date: 2020/7/30
 * Time: 上午8:55
 * Email: 1328312923@qq.com
 * Description: No Description
 **/
public class PredicateTest {
    public static void main(String[] args) {
        Predicate<Integer> predicate1 = x -> x > 0;
        Predicate<Integer> predicate2 = x -> x <= 0;
        System.out.println(predicate1.and(predicate2).test(1));
        System.out.println(predicate1.or(predicate2).test(1));
        System.out.println(predicate2.negate().test(1));

    }
}
